package org.zjh.controller.listener;

import org.zjh.controller.GameController;
import org.zjh.utils.PokerUtil;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * @description: 明牌监听
 * @author 郑佳豪
 * @date 2024/10/17 15:59
 * @version 1.0
 */
public class PokerFaceUpLis extends MouseAdapter {
    private boolean isClicked  = false;


    @Override
    public void mouseClicked(MouseEvent e) {
        if (isClicked){ //以及被点击了 那么就扑克牌朝下
            PokerUtil.pokerDown(GameController.getInstance().getComputerA().getPokerList());
            PokerUtil.pokerDown(GameController.getInstance().getComputerB().getPokerList());
            isClicked = false;
        }else{ //没被点击就 扑克牌朝上
            PokerUtil.pokerUp(GameController.getInstance().getComputerA().getPokerList());
            PokerUtil.pokerUp(GameController.getInstance().getComputerB().getPokerList());
            isClicked = true;
        }
    }
}
